import java.util.Vector;
import java.util.Scanner;

public class WapperTest3
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        Vector v = new Vector();

        int score = in.nextInt();

        do
        {
            Integer i = score;
            v.addElement(i);
            score = in.nextInt();

        }while (score >= 0);

        int maxSocer = ((Integer)v.elementAt(0)).intValue();

        for (int i = 1; i < v.size(); i++)
        {
            if (((Integer)v.elementAt(i)).intValue() > maxSocer)
            {
                maxSocer = ((Integer)v.elementAt(i)).intValue();
            }
        }

        System.out.println("最高分: " + maxSocer);

        for (int i = 0; i < v.size(); i++)
        {
            switch((maxSocer - ((Integer)v.elementAt(i)).intValue()) / 10)
            {

                case 0:
                    System.out.println("student " + i + "score is " + ((Integer)v.elementAt(i)).intValue() + "\tgrade is " + "A");
                    break;
                case 1:
                    System.out.println("student " + i + "score is " + ((Integer)v.elementAt(i)).intValue() + "\tgrade is " + "B");
                    break;
                case 2:
                    System.out.println("student " + i + "score is " + ((Integer)v.elementAt(i)).intValue() + "\tgrade is " + "C");
                    break;
                default:
                    System.out.println("student " + i + "score is " + ((Integer)v.elementAt(i)).intValue() + "\tgrade is " + "D");
                    break;
            }
        }
    }
}
